home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-13
/
amac44a.zip
/
BUFF13.QM
< prev
next >
Wrap
Text File
|
1992-02-17
|
47KB
|
874 lines
* BUFF13.QM, v1.3a
* Access Scratch Buffers with the Previous Buffer Name at Prompt,
* Save and Reload Currently Loaded Buffers at Next Edit Session
* 2/17/92
*
* Key Subfile Description
* ===== ============= ==============================================
* ^(2_)- {e:\up\FILE*} Copy CurrentFileName to Scrap/Scratch Buffers |new
* Without Changing Edit Status of Current File
* ^(6_)- {e:\up\FILE*} Get CurrentFileName from Scratch Buffer |new
* Without Changing Edit Status of Current File
*
* @(F1)- Clear Scrap and Scratch Buffers |new
* @(F2)- Cut CurrentFileName Extension To Scrap |new
* @(F3)- Cut CurrentFileName Extension To Scrap, |new
* Adds Dot If No Extension
* ------------------- Insert Buffer Name at Prompt -------------------*
* @(1) - STORE or Copy Marked Block ┐
* @(2) - GET or Insert Buffer Contents ├─ Require v2.15
* @(3) - APPEND Marked Block ┘
* @(4) - Remove Buffer Contents
*
* ---------------- Contents Selected From a PickList ----------------*
* @(7) - GET or Insert Buffer Contents
* @(8) - Remove Buffer Contents
*
* @(6) - View Contents of All Currently Loaded Buffers
* @(9) - Save Contents of All Currently Loaded Buffers
* @(0) - Load Buffers From Previous Edit Session
*
* (Description)
* (Configuration) Required <<<<<-- Please read this FIRST
* (Macros)
* (Version) History
*
*--- eoi
* (DESCRIPTION)
* These macros access and manipulate Scratch Buffers the same way
* StoreScrBuff, GetScrBuff and AppendScrBuff do except the last
* accessed buffer name is entered at the buffer name prompt when
* macros @1 - @4 are invoked. This is especially useful when a few
* Scratch Buffers are frequently accessed because QEdit does not
* remember and show the last accessed Scratch Buffer name at the
* buffer name prompt without having to recall and enter the buffer
* name. Macro @6 will show the contents of all loaded Scratch
* Buffers by name. Macros @7 and @8 enable the user to access
* Scratch Buffers from a PickList of all loaded Scratch Buffers by
* name. All currently loaded Scratch Buffers may also be saved
* with @9 and reloaded with @0 at the next edit session or at start
* up.
* All macros, except @0, will fit on one line of QCONFIG.DAT by
* removing the 'Label' and 'Macro_Begin' from the QMAC compiled
* macros and formatting with a right margin of 500, and then
* using joinline to get any remaining commands on the same line.
* Macros @1 - @6 will work with line, character or column blocks,
* however macros @7 -@0 will ONLY work with line or character
* blocks, NO column blocks.
* (CONFIGURATION)
* NOTE: 1) Macros @1 - @4 are the only macros not requiring
* configuration. You must change 'e:\up\' in macros @6 - @0 to
* your directory containing the files for BUFFxx.QM macros, then
* recompile using QMAC.
* 2) The following files must either exist or must be made as
* described below:
* BUFF.BAT batch file to invoke @0
* BUFF.NAM list of Scratch Buffer names to be used
* BUFF.ALL all currently loaded Scratch Buffers,
* @9 makes this file when invoked
* 3) Macros @1 - @4 require QEdit v2.15.
* (MACROS)
*
* ----------------------------------------------
* @(0) Load Buffers From Previous Edit Session
* ----------------------------------------------
* This macro enables the user to load, either upon start up or
* while editing, all Scratch Buffers that were saved in the last
* edit session using @9. This macro is a modification of a macro
* in the QEdit documentation to load a set of "standard" buffers.
* @0 may also be invoked while editing.
* This macro will ONLY work with line or character blocks, NO
* column blocks. Any column block buffer saved with @9 will be
* loaded with @0 as a CHARACTER block. To run, invoke this macro
* at any time or at startup as described below, and the macro
* terminates with all buffers that were saved in the last editing
* session with @9 loaded and shown in the NUL file for viewing. The
* NUL file may be quit but this is not necessary.
* To invoke this macro at start up and load this file, it's macros,
* and the scratch buffers saved in the last editing session, use
* the following batch file BUFF.BAT contained in AMACxx.ZIP:
* ┌────────────────────── BUFF.BAT ──────────────────────┐
* │ │
* │ Q BUFF13.QM /EBUFF13.MAC /LBUFF13.MAC │
* │ │
* └──────────────────────────────────────────────────────┘
* The user may wish to modify BUFF.BAT by changing e:\up\ in the
* statement line to the directory containing BUFF.BAT so that all
* macros in BUFFxx.QM will be available to invoke from any
* directory. To invoke this macro while editing press @0.
* NOTE: You must change 'e:\up\' in this macro to your directory
* containing BUFF.ALL. @0 must be the first macro in this
* file to autoexecute on start up. All Scratch Buffers will
* be changed to character blocks with @6 and @0.
@0 macrobegin
* ------------- Load Buffers From Previous Edit Session -------------*
editfile
'e:\up\BUFF.ALL' return * Load last buffer file
* Change 'e:\up\' to your directory
begfile * Go to the top of it
markline copy * Copy first buffer name to scrap
cursordown * Cursor down to first buffer
markblockbegin * Mark beginning of buffer
find #254 return delline return * Find the end of the buffer marker
markblockend * Mark the end of buffer
storescrbuff paste return * Store the buffer to name
cursordown * Cursor down to second buffer
LOOP: * Do same thing for next buffer
unmarkblock * Clear buffer content block
begline * Re-position from Find
markline * Mark buffer name
copy * Copy name to scrap
cursordown * Are we at bottom of file yet?
jfalse DONE * If we can't cursor down, we're done
markblockbegin *ELSE mark buffer begin
repeatfind * Find end of buffer marker
cursorleft * Test if we're on marker in col 1
jtrue 1 * If true, we're not in col 1
insertline *ELSE we need to insert line for buff
cursordown * Move back to marker line
jump 2 * Bypass next line
1: cursorright * Position cursor back on marker
2: markblockend * Mark buffer end
storescrbuff paste return * Store buffer to name
cursordown * Cursor down to next buffer name
jump LOOP * Loop again
DONE: * Come here when no more names
quit * Quit BUFF.ALL
* ---------- View Contents of All Currently Loaded Buffers ----------*
onewindow * In case @0 invoked while editing
editfile "NUL" return quit * Quit NUL file if loaded
horizontalwindow * Make two windows
editfile return * Load empty NUL file
readblock * Read file of buffer names
"e:\up\BUFF.NAM" return * Change 'e:\up\' to your directory
LOOP2:
begline * Needed in loop
unmarkblock
markline * Mark next buffer name
copy * Copy name to scrap
addline * Make room for buff contents
getscrbuff paste return * Get buffer contents
endline * Pos and test if buff has contents
jfalse NOBUFF * If buffer has no contents, move on
gotoblockend * Go to end of buffer contents
ENDLINE * Pos for end of buffer mark
* Needed for last buffer line blank
#254 * Add end of buffer mark
cursordown * Move down to next line
begline endline * Test if line is blank
jfalse DELLINE * If blank, go delete it
jump LOOP2 *ELSE loop again
NOBUFF: * Come here if nothing in buffer
cursordown * Test if we're at end of buffer names
jfalse PICK * If false, PickList is made
cursorup *ELSE cursor up to blank line
cursorup * and to name with no content
delline * Delete buffer name
DELLINE:
delline * Delete blank line
jump LOOP2 * Loop again
PICK: * Come here to select from PickList
zoomwindow * Full window for visibity
unmarkblock * Clear last buffer content's block
begfile * Position to view
onewindow * Close windows if QConfig
END: * set to NOT close on quit
*
* 162 bytes Tue 08-20-1991 11:21:31 (TH @0)
*
* --------------------------------------------------------------------------
* @(1) STORE or Copy Marked Block to Previous or New Buffer Name,
* Previous Buffer Name is Entered at Request for Buffer Name Prompt
* --------------------------------------------------------------------------
* This macro copies the currently marked Block to the named Scratch
* Buffer. The last accessed buffer name is entered at request for
* buffer name prompt. Blocks may be either line, character or
* column blocks--open or closed.
* The editor will prompt for the name of the Scratch Buffer with
* this macro entering the name of the last accessed buffer invoked,
* on the 'Request for Buffer Name Prompt' line. If no buffer has
* been previously named with these macros, the 'Buffer Name Prompt'
* is blank for user entry. The previously named buffer may be
* overwritten or selected by hitting <enter>. If no buffer name is
* entered at the 'Request for Buffer Name Prompt', the macro uses
* the default Scratch Buffer name dot '.'
@1 macrobegin
SetScreenOff
onewindow
editfile "NUL" return quit * Quit NUL file if loaded
GotoBlockBeg * Test if closed
jfalse END
storescrbuff "t" return * Store block to temp buff 't'
deleteblock * Delete block to put back later
horizontalwindow * Make two windows
editfile return * Load empty NUL file
SetInsMode ToggleInsert
getscrbuff "n" return * Get previous buff 'n'
gotoblockbeg * Test if buff 'n' had contents
jtrue NEXT * If buffer exists, bypass next line
dropanchor *ELSE make dummy block so cut does
* not cut empty line to scrap
NEXT:
cut * Cut prev buff name to scrap
"Buff=" * Insert Buff= on top line of NUL
paste * Paste prev buff name
markcharacter * Start character block
zoomwindow * Make NUL file full window
SetScreenOn Pause SetScreenOff
endline * Get all name in block
dropanchor * Close block
gotoblockbeg * Pos cursor on first char of name
endline * Test if char exists
jtrue HasName * If true, buff has name
"." *ELSE no buff named, name it 'dot'
HasName: * Buff now has name
storescrbuff "n" return * Store name to buff 'n'
copy * Copy buff name to scrap
getscrbuff "t" return * Insert temp buff 't'
storescrbuff paste return * Save it with new buff name
toggleinsert * Toggle Insert back On
quit * Quit NUL file
prevwindow * Return to starting file
getscrbuff paste return * Put orig block back where it was
onewindow * Close all windows if QConfig
END: * set to NOT close on quit
*
* 89 bytes Mon 08-19-1991 13:42:56 (TH @1)
* 83 bytes Sat 10-26-1991 07:47:01 (TH @1, v2.15)
*
* --------------------------------------------------------------------------
* @(2) GET or Insert Previous or New Buffer Name Contents at Cursor Position,
* Previous Buffer Name is Entered at Request for Buffer Name Prompt
* --------------------------------------------------------------------------
* This macro inserts the contents of the named Scratch Buffer at
* the cursor position. The last accessed buffer name is entered at
* request for buffer name prompt. Blocks may be either line,
* character or column blocks--open or closed.
* The editor will prompt for the name of the Scratch Buffer. The
* macro enters the name of the last accessed buffer name invoked on
* the 'Request for Buffer Name Prompt' line. If no buffer has been
* previously named with these macros, the 'Buffer Name Prompt' is
* blank for user entry. The previously named buffer may be
* overwritten or selected by hitting <enter>. If no buffer name is
* entered at the 'Request for Buffer Name Prompt', the macro uses
* the scratch buffer name dot '.'
@2 macrobegin
SetScreenOff
onewindow * Close all windows
dropanchor * Mark starting file to return to
editfile "NUL" return quit * Quit NUL file if loaded
GotoBlockBeg * Return to starting file
unmarkblock * Unmark
horizontalwindow * Make two windows
editfile return * Load empty NUL file
SetInsMode ToggleInsert
getscrbuff "n" return * Get previous buff 'n'
gotoblockbeg * Test if buff 'n' had contents
jtrue NEXT * If buffer exists, bypass next line
dropanchor * Make dummy block so cut does not
* cut empty line to scrap
NEXT:
cut * Cut prev buff name to scrap
"Buff=" * Insert Buff= on top line of NUL
paste * Paste prev buff name
markcharacter * Start character block
zoomwindow * Make NUL file full window
SetScreenOn Pause SetScreenOff
endline * Get all name in block
dropanchor * Close block
gotoblockbeg * Pos cursor on first char of name
endline * Test if char exists
jtrue HasName * If true, buff has name
"." *ELSE no buff named, name it 'dot'
HasName: * Buff now has name
storescrbuff "n" return * Store name to buff 'n'
copy * Copy buff name to scrap
toggleinsert * Toggle Insert back On
quit * Quit NUL file
prevwindow * Return to starting file
getscrbuff paste return * Insert buff contents here
onewindow * Close all windows if QConfig
END: * set to NOT close on quit
*
* 76 bytes Mon 08-19-1991 13:43:05 (TH @2)
* 70 bytes Sat 10-26-1991 07:58:29 (TH @2, v2.15)
*
* --------------------------------------------------------------------------
* @(3) APPEND Marked Block to End of Previous or New Buffer Name,
* Previous Buffer Name is Entered at Request for Buffer Name Prompt
* --------------------------------------------------------------------------
* This macro appends the currently marked Block to the end of the
* named Scratch Buffer. The last accessed buffer name is entered
* at request for buffer name prompt. The existing contents of the
* named Scratch Buffer are not lost invoking this macro. If the
* named Scratch Buffer does not exist, a new Scratch Buffer will be
* created. Blocks may be either line, character or column
* blocks--open or closed.
* The editor will prompt for the name of the Scratch Buffer. The
* macro enters the name of the last accessed buffer name invoked on
* the 'Request for Buffer Name Prompt' line. If no buffer has been
* previously named with these macros, the 'Buffer Name Prompt' is
* blank for user entry. The previously named buffer may be
* overwritten or selected by hitting <enter>. If no buffer name is
* entered at the 'Request for Buffer Name Prompt', the macro uses
* the scratch buffer name dot '.'
@3 macrobegin
SetScreenOff
onewindow
editfile "NUL" return quit * Quit NUL file if loaded
GotoBlockBeg * Test if closed
jfalse END
storescrbuff "t" return * Store block to temp buff 't'
deleteblock * Delete block to put back later
horizontalwindow * Make two windows
editfile return * Load empty NUL file
SetInsMode ToggleInsert
getscrbuff "n" return * Get previous buff 'n'
gotoblockbeg * Test if buff 'n' had contents
jtrue NEXT * If buffer exists, bypass next line
dropanchor * Make dummy block so cut does not
* cut empty line to scrap
NEXT:
cut * Cut prev buff name to scrap
"Buff=" * Insert Buff= on top line of NUL
paste * Paste prev buff name
markcharacter * Start character block
zoomwindow * Make NUL file full window
SetScreenOn Pause SetScreenOff
endline * Get all name in block
dropanchor * Close block
gotoblockbeg * Pos cursor on first char of name
endline * Test if char exists
jtrue HasName * If true, buff has name
"." *ELSE no buff named, name it 'dot'
HasName: * Buff now has name
storescrbuff "n" return * Store name to buff 'n'
copy * Copy buff name to scrap
getscrbuff "t" return * Insert temp buff 't'
appendscrbuff paste return * Append block to buff 'n'
toggleinsert * Toggle Insert back On
quit * Quit NUL file
prevwindow * Return to starting file
getscrbuff "t" return * Put orig block back where it was
onewindow * Close all windows if QConfig
END: * set to NOT close on quit
*
* 90 bytes Mon 08-19-1991 13:43:01 (TH @3)
* 84 bytes Sat 10-26-1991 07:58:42 (TH @3, v2.15)
*
* --------------------------------------------------------------------------
* @(4) Remove Buffer Contents with Previous Buffer Name at Prompt
* --------------------------------------------------------------------------
* This macro removes the contents of the named Scratch Buffer. The
* last accessed buffer name is entered at request for buffer name
* prompt. Blocks may be either line, character or column
* blocks--open or closed. This macro is useful for freeing up
* buffer space or removing buffers before saving with @9.
* The editor will prompt for the name of the Scratch Buffer. The
* macro enters the name of the last accessed buffer name invoked on
* the 'Request for Buffer Name Prompt' line. If no buffer has been
* previously named with these macros, the 'Buffer Name Prompt' is
* blank for user entry. The previously named buffer may be
* overwritten or selected by hitting <enter>. If no buffer name is
* entered at the 'Request for Buffer Name Prompt', the macro uses
* the scratch buffer name dot '.'
@4 macrobegin
SetScreenOff
onewindow * Close all windows
dropanchor * Mark starting file to return to
editfile "NUL" return quit * Quit NUL file if loaded
GotoBlockBeg * Return to starting file
unmarkblock * Unmark
horizontalwindow * Make two windows
editfile return * Load empty NUL file
SetInsMode ToggleInsert
getscrbuff "n" return * Get previous buff 'n'
gotoblockbeg * Test if buff 'n' had contents
jtrue NEXT * If buffer exists, bypass next line
dropanchor * Make dummy block so cut does not
* cut empty line to scrap
NEXT:
cut * Cut prev buff name to scrap
"Buff=" * Insert Buff= on top line of NUL
paste * Paste prev buff name
markcharacter * Start character block
zoomwindow * Make NUL file full window
SetScreenOn Pause SetScreenOff
endline * Get all name in block
dropanchor * Close block
gotoblockbeg * Pos cursor on first char of name
endline * Test if char exists
jtrue HasName * If true, buff has name
"." *ELSE no buff named, name it 'dot'
HasName: * Buff now has name
storescrbuff "n" return * Store name to buff 'n'
copy * Copy buff name to scrap
toggleinsert * Toggle Insert back On
endline dropanchor * Mark empty block
storescrbuff paste return * Store empty block to buff n
* clears it
quit * Quit NUL file
prevwindow * Return to starting file
onewindow * Close all windows if QConfig
END: * set to NOT close on quit
*
* 78 bytes Tue 08-20-1991 11:34:56 (TH @a)
* 72 bytes Sat 10-26-1991 07:59:04 (TH @4)
*
* ----------------------------------------------------
* @(6) View Contents of All Currently Loaded Buffers
* ----------------------------------------------------
* This macro enables the user to view the contents of all currently
* loaded Scratch Buffers. This macro uses the technique in a macro
* in the QEdit documentation to load a set of "standard" buffers.
* This macro will ONLY work with line or character blocks, NO
* column blocks. To run, press @6 and <enter> and the contents of
* all currently loaded Scratch Buffers is shown in the NUL file for
* viewing in the following form:
* ┌────── NUL ──────┐
* │1 │<-- Buffer 1 name
* │Text of buffer 1■ │<-- Buffer 1 content
* │2 │<-- Buffer 2 name
* │This is content of │<-- Buffer 2 content
* │buffer number 2. │ |
* │ │ |
* │Note that buffers may │ |
* │contain any text │ |
* │except for an ASCII │ |
* │254. That is used │ |
* │as an end of buffer │ |
* │marker │ |
* │■ │<-- NOTE: delimiter on line by itself
* │3 │ indicates a blank line.
* │Buffer 3■ │
* └──────────────────────┘
* After viewing the buffer contents, the NUL file may be quit but
* this is not necessary.
* NOTE: You must change 'e:\up\' in this macro to your directory
* containing BUFF.NAM. This file must exist for this macro
* to work and it is easily made as shown below.
* File BUFF.NAM is a list of buffer names to be used:
* 1 to 10
* a to z (excluding n and t)
* . (dot)
* ┌───── BUFF.NAM ──────┐
* │1 │<-- Buffer names 1 - 10
* │2 │
* │3 │
* │4 │
* │5 │
* │6 │
* │7 │
* │8 │
* │9 │
* │10 │
* │a │ <-- Buffer names a - z
* │b │ excluding 'n' and 't'
* │| │ reserved for BUFFxx.QM macros.
* │| │
* │z │
* │. │ <-- Buffer name '.' (dot) is
* └──────────────────────┘ reserved as default name.
@6 macrobegin
onewindow
dropanchor * Mark file we're in to return to
editfile "NUL" return quit * Quit NUL file if loaded
gotoblockbeg * Return to starting file
unmarkblock * Clear mark
horizontalwindow * Make two windows
editfile return * Load empty NUL file
readblock * Read file of buffer names
"e:\up\BUFF.NAM" return * Change 'e:\up\' to your directory
LOOP:
begline * Needed in loop
unmarkblock
markline * Mark next buffer name
copy * Copy name to scrap
addline * Make room for buff contents
getscrbuff paste return * Get buffer contents
endline * Pos and test if buff has contents
jfalse NOBUFF * If buffer has no contents, move on
gotoblockend * Go to end of buffer contents
ENDLINE * Pos for end of buffer mark
* Needed for last buffer line blank
jtrue 1
gotoblockend
1: #254 * Add end of buffer mark
cursordown * Move down to next line
begline endline * Test if line is blank
jfalse DELLINE * If blank, go delete it
jump LOOP *ELSE loop again
NOBUFF: * Come here if nothing in buffer
cursordown * Test if we're at end of buffer names
jfalse PICK * If false, PickList is made
cursorup *ELSE cursor up to blank line
cursorup * and to name with no content
delline * Delete buffer name
DELLINE:
delline * Delete blank line
jump LOOP * Loop again
PICK: * Come here to select from PickList
zoomwindow * Full window for visibity
unmarkblock * Clear last buffer content's block
begfile * Position to view
onewindow * Close windows if QConfig
END: * set to NOT close on quit
*
* 78 bytes Mon 08-19-1991 13:43:19 (TH @6)
* 94 bytes Tue 08-20-1991 11:22:00 (TH @6, added e:\up)
*
* ---------------------------------------------------------
* @(7) GET or Insert Buffer Contents at Cursor Position
* From a PickList of All Currently Loaded Buffers
* ---------------------------------------------------------
* This macro enables the user to insert a Scratch Buffer at the
* cursor position selected from a PickList of all currently loaded
* Scratch Buffers. At the pause, place the cursor line on the name
* of the buffer to insert and press <enter>. The selected buffer
* will be inserted at the cursor position when this macro was
* invoked.
* This macro will ONLY work with line or character blocks, NO
* column blocks.
* NOTE: You must change 'e:\up\' in this macro to your directory
* containing BUFF.NAM. This file must exist for this macro
* to work and it is easily be made as shown below.
@7 macrobegin
onewindow
dropanchor * Mark file we're in to return to
editfile "NUL" return quit * Quit NUL file if loaded
gotoblockbeg * Return to starting file
unmarkblock * Clear mark
horizontalwindow * Make two windows
editfile return * Load empty NUL file
readblock * Read file of buffer names
"e:\up\BUFF.NAM" return * Change 'e:\up\' to your directory
LOOP:
begline * Needed in loop
unmarkblock
markline * Mark next buffer name
copy * Copy name to scrap
addline * Make room for buff contents
getscrbuff paste return * Get buffer contents
endline * Pos and test if buff has contents
jfalse NOBUFF * If buffer has no contents, move on
gotoblockend * Go to end of buffer contents
ENDLINE * Pos for end of buffer mark
* Needed for last buffer line blank
#254 * Add end of buffer mark
cursordown * Move down to next line
begline endline * Test if line is blank
jfalse DELLINE * If blank, go delete it
jump LOOP *ELSE loop again
NOBUFF: * Come here if nothing in buffer
cursordown * Test if we're at end of buffer names
jfalse PICK * If false, PickList is made
cursorup *ELSE cursor up to blank line
cursorup * and to name with no content
delline * Delete buffer name
DELLINE:
delline * Delete blank line
jump LOOP * Loop again
PICK: * Come here to select from PickList
zoomwindow * Full window for visibity
unmarkblock * Clear last buffer content's block
begfile * Position to select
pause * Pause to select
markline copy * Copy selected buffer name to scrap
prevwindow * Return to starting file
getscrbuff paste return * Insert selected buffer contents here
prevwindow * Return to NUL
quit * Quit NUL
onewindow * Close windows if QConfig
END: * set to NOT close on quit
*
* 99 bytes Tue 08-20-1991 11:21:50 (TH @7)
*
* ----------------------------------------------------
* @(8) Remove Buffer Contents Selected From a
* PickList of All Currently Loaded Buffers
* ----------------------------------------------------
* This macro enables the user to remove an un-desired Scratch
* Buffer from currently loaded Scratch Buffers selected from a
* PickList of all currently active Scratch Buffers. At the pause,
* place the cursor line on the name of the buffer to remove and
* press <enter>. The selected buffer will be removed or cleared
* from currently loaded Scratch Buffers as can be confirmed
* invoking @6 after @8. This macro is useful for either freeing up
* memory or removing macros not wished to be saved with @9.
* This macro will ONLY work with line or character blocks, NO
* column blocks.
* NOTE: You must change 'e:\up\' in this macro to your directory
* containing BUFF.NAM. This file must exist for this macro
* to work and it is easily be made as shown below.
@8 macrobegin
onewindow
dropanchor * Mark file we're in to return to
editfile "NUL" return quit * Quit NUL file if loaded
gotoblockbeg * Return to starting file
unmarkblock * Clear mark
horizontalwindow * Make two windows
editfile return * Load empty NUL file
readblock * Read file of buffer names
"e:\up\BUFF.NAM" return * Change 'e:\up\' to your directory
LOOP:
begline * Needed in loop
unmarkblock
markline * Mark next buffer name
copy * Copy name to scrap
addline * Make room for buff contents
getscrbuff paste return * Get buffer contents
endline * Pos and test if buff has contents
jfalse NOBUFF * If buffer has no contents, move on
gotoblockend * Go to end of buffer contents
ENDLINE * Pos for end of buffer mark
* Needed for last buffer line blank
#254 * Add end of buffer mark
cursordown * Move down to next line
begline endline * Test if line is blank
jfalse DELLINE * If blank, go delete it
jump LOOP *ELSE loop again
NOBUFF: * Come here if nothing in buffer
cursordown * Test if we're at end of buffer names
jfalse PICK * If false, PickList is made
cursorup *ELSE cursor up to blank line
cursorup * and to name with no content
delline * Delete buffer name
DELLINE:
delline * Delete blank line
jump LOOP * Loop again
PICK: * Come here to select from PickList
unmarkblock * Clear last buffer content's block
zoomwindow * Full window for visibity
begfile * Position to select
pause * Pause to select
markline copy * Copy selected buffer name to scrap
endline * Position of empty space
dropanchor * Mark empty space
storescrbuff paste return * Store empty block to selected buff
* removes buffer contents
unmarkblock * Unmark
quit * Quit NUL
prevwindow * Return to starting file
onewindow * Close windows if QConfig
END: * set to NOT close on quit
*
* 101 bytes Tue 08-20-1991 11:18:24 (TH @8)
*
* ----------------------------------------------------
* @(9) Save Contents of All Currently Loaded Buffers
* To Reload at Next Edit Session with @0
* ----------------------------------------------------
* This macro saves the contents of all currently loaded Scratch
* Buffers to a file BUFF.ALL to be loaded at the next edit session
* or while editing using @0. This macro will ONLY work with line
* or character blocks, NO column blocks. Any column block buffer
* saved with @9 will be loaded with @0 as a CHARACTER block. To
* run, invoke this macro at any time, and the macro terminates with
* the file BUFF.ALL containing all Scratch Buffers currently active
* and having names contained in the file BUFF.NAM, loaded for
* viewing. Terminate the editing session or quit the file BUFF.ALL
* to continue.
* NOTE: You must change 'e:\up\' to your directory containing
* BUFF.ALL and BUFF.NAM.
* File BUFF.NAM must exist and is a list of buffer names used. It
* is included in AMACxx.ZIP and contains the following buffer names
* in col 1.
* 1 to 10
* a to z
* . (dot)
* Edit BUFF.NAM to suit your needs. Buffer names may also be
* multiple words.
* ┌───── BUFF.NAM ──────┐
* │1 │<-- Buffer names 1 - 10
* │2 │
* │3 │
* │4 │
* │5 │
* │6 │
* │7 │
* │8 │
* │9 │
* │10 │
* │a │ <-- Buffer names a - z
* │b │ excluding 'n' and 't'
* │| │ reserved for BUFFxx.QM macros.
* │| │
* │z │
* │. │ <-- Buffer name '.' (dot) is
* └──────────────────────┘ reserved as default name.
* The file BUFF.ALL is the contents of Scratch Buffers (Sample from
* my last editing session is included in AMACxx.ZIP) saved with @9
* in the form:
* ┌────── BUFF.ALL ──────┐
* │1 │<-- Buffer 1 name
* │Text of buffer 1■ │<-- Buffer 1 content
* │2 │<-- Buffer 2 name
* │This is content of │<-- Buffer 2 content
* │buffer number 2. │ |
* │ │ |
* │Note that buffers may │ |
* │contain any text │ |
* │except for an ASCII │ |
* │254. That is used │ |
* │as an end of buffer │ |
* │marker │ |
* │■ │<-- NOTE: delimiter on line by itself
* │3 │ indicates a blank line.
* │Buffer 3■ │
* └──────────────────────┘
* Buffers to be saved may contain any ASCII character except #254,
* the end of buffer marker. All scratch buffers are loaded and
* marked as CHARACTER blocks.
@9 macrobegin
onewindow
dropanchor * Mark file we're in to return to
editfile "NUL" return quit * Quit NUL file if loaded
gotoblockbeg * Return to starting file
unmarkblock * Clear mark
horizontalwindow * Make two windows
editfile return * Load empty NUL file
readblock * Read file of buffer names
"e:\up\BUFF.NAM" return * Change 'e:\up\' to your directory
LOOP:
begline * Needed in loop
unmarkblock
markline * Mark next buffer name
copy * Copy name to scrap
addline * Make room for buff contents
getscrbuff paste return * Get buffer contents
endline * Pos and test if buff has contents
jfalse NOBUFF * If buffer has no contents, move on
gotoblockend * Go to end of buffer contents
ENDLINE * Pos for end of buffer mark
* Needed for last buffer line blank
#254 * Add end of buffer mark
cursordown * Move down to next line
begline endline * Test if line is blank
jfalse DELLINE * If blank, go delete it
jump LOOP *ELSE loop again
NOBUFF: * Come here if nothing in buffer
cursordown * Test if we're at end of buffer names
jfalse PICK * If false, PickList is made
cursorup *ELSE cursor up to blank line
cursorup * and to name with no content
delline * Delete buffer name with no content
DELLINE:
delline * Delete blank line
jump LOOP * Loop again
PICK:
writeblock * Begin writeblock
backspace backspace backspace * Remove 'nam' extension
"ALL" return "O" * Save all scratch buffer contents
* to BUFF.ALL with overwrite
editfile return quit * Quit BUFF.ALL if loaded
editfile return * Load BUFF.ALL to see if all Ok
onewindow * Close windows
END:
*
* 105 bytes Tue 08-20-1991 11:22:05 (TH @9)
*
* ----------------------------------------------------------------------
* @(F1) Clear Scrap and Scratch Buffers
* ----------------------------------------------------------------------
@F1 macrobegin
endline cursorright #254 cursorleft cursorleft
unmarkblock dropanchor
storescrbuff "name" return
copy deltoeol begline
*
* 25 bytes Mon 02-17-1992 11:28:39 (TH @F1)
*
* ----------------------------------------------------------------------
* @(F2) Cut CurrentFileName Extension To Scrap
* ----------------------------------------------------------------------
@6 macrobegin insertline unmarkblock markline currentfilename
find "." return "LB" return jfalse NOEXT
cursorright
NOEXT:
unmarkblock markcolumn endline cut pause delline
*
* 27 bytes Mon 01-27-1992 20:12:19 (TH @F2)
*
* ----------------------------------------------------------------------
* @(F3) Cut CurrentFileName Extension To Scrap, Adds Dot If No Extension
* ----------------------------------------------------------------------
@F3 macrobegin insertline unmarkblock markline currentfilename
find "." return "LB" return jtrue HASEXT
"." cursorleft
HASEXT:
cursorright unmarkblock markcolumn endline cut pause delline
*
* 30 bytes Mon 01-27-1992 20:12:29 (TH @F3)
* (VERSION) HISTORY
* 1.0 - Initial. Includes @1, @2 and @3. 8/17/91
* 1.1 - Added @6. Modified @1, @2 and @3. 8/19/91
* 1.2 - Added @4 and @7 - @0. 8/20/91
* - Swapped @2 and @3 keys. 8/22/91
* 1.2a- Modified documentation. Changed BUFF.ALL contents. 9/6/91
* 1.3 - Modified @1-4 for QEdit v2.15. 10/26/91
* - Removed colon from jump, jtrue and jfalse. 11/11/91
* 1.3a- Added @F1/F2/F3. 2/17/92
*
*
*-- eof